import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class ExceptionTest01 {

    public static void main(String[] args) {

        try{
            m1();
        }catch(FileNotFoundException e)
        {
            String s = e.getMessage();
            System.out.println(s);  //C:\jetns-aagent.jar (系统找不到指定的文件。)
           // e.printStackTrace();
            //java.io.FileNotFoundException: C:\jetns-aagent.jar (系统找不到指定的文件。)
            //	at java.base/java.io.FileInputStream.open0(Native Method)
            //	at java.base/java.io.FileInputStream.open(FileInputStream.java:216)
            //	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
            //	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:111)
            //	at ExceptionTest01.m3(ExceptionTest01.java:23)
            //	at ExceptionTest01.m2(ExceptionTest01.java:20)
            //	at ExceptionTest01.m1(ExceptionTest01.java:17)
            //	at ExceptionTest01.main(ExceptionTest01.java:8)
            System.out.println("文件可能不存在！");
        }
        System.out.println("hello world");

        //m1();  //java: 未报告的异常错误java.io.FileNotFoundException;
        //System.out.println("hello world");   //不会输出
    }
    private static void m1() throws FileNotFoundException{
        m2();
    }
    private static void m2() throws FileNotFoundException{
        m3();
    }
    private static void m3() throws FileNotFoundException{
        new FileInputStream("C:\\jetns-aagent.jar");
    }

}
